<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var buffer = new ArrayBuffer(16);
  var u8a = new Uint8Array(buffer);

  console.log(buffer)
  console.log(u8a)

  u8a = new Uint8Array(buffer, 10);

  console.log(u8a, u8a.length, u8a.buffer.byteLength)

  var u8c = u8a.slice(0);

  console.log(u8c, u8c.length, u8c.buffer.byteLength)
  console.log(u8a, u8a.length, u8a.buffer.byteLength)

  u8c[0] = 0xff
  u8c[1] = 0x24
  u8c[2] = 0xd4
  u8c[3] = 0xa4

  console.log(u8c)
  console.log(u8c[0], u8c[0].toString(16))
  console.log(u8c[1], u8c[1].toString(16))
  console.log(u8c[2], u8c[2].toString(16))
  console.log(u8c[3], u8c[3].toString(16))

  var u8d = u8a.slice(0);
  u8d[0] = 254
  u8d[1] = 36
  u8d[2] = 212
  u8d[3] = 164

  console.log(u8d[0], u8d[0].toString(16), u8d[0].toString(2))
  console.log(u8d[1], u8d[1].toString(16), u8d[1].toString(2))
  console.log(u8d[2], u8d[2].toString(16), u8d[2].toString(2))
  console.log(u8d[3], u8d[3].toString(16), u8d[3].toString(2))
</script>
</body>
</html>
